<?php
namespace ITSociaal\Themes\Houtgrutter;

abstract class StringRendererFactory implements RendererFactoryInterface
{
	/**
	 * Produces RendererInterface for the given template name
	 *
	 * Based on template name alone, for testing purposes
	 *
	 * @param string                             $name
	 * @param \ITSociaal\Themes\Houtgrutter\Util $util
	 *
	 * @return \ITSociaal\Themes\Houtgrutter\RendererInterface
	 */
	public static function create($name, Util $util)
	{
		$name = htmlspecialchars(
			$name,
			ENT_NOQUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED|ENT_HTML5
		);

		return $util
			->createObject(StringRenderer::class)
			->setString("<h1>$name</h1>");
	}
}

/* vi:set ts=4 sw=4 noet: */
